package com.nuoniu.sibanyun.controller.crm.call;


import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.crm.call.dto.CrmCallBaseSettingInfoSearchDto;
import com.nuoniu.sibanyun.service.crm.call.ICrmCallBaseSettingInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 客户管理-外呼套餐基础信息 前端控制器
 * </p>
 *
 * @author 白强
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/crm/callBaseSettingInfo")
@Api(value="外呼套餐基础信息 ",tags={"外呼套餐基础信息"})
public class CrmCallBaseSettingInfoController extends BaseController {

    @Autowired
    private ICrmCallBaseSettingInfoService baseSettingInfoService;

    @PostMapping("pageList")
    @ApiOperation(value = "分页查询 正在使用的套餐信息")
    @PreAuthorize("'system' == authentication.principal ")
    public HttpResult pageAgentStatisticsBySystem(@RequestBody CrmCallBaseSettingInfoSearchDto settingInfoSearchDto) {
        return HttpResult.ok(baseSettingInfoService.pageList(settingInfoSearchDto));
    }


    @GetMapping("getByCompany")
    @ApiOperation(value = "查询租户当前套餐信息")
    public HttpResult getByCompany() {
        return HttpResult.ok(baseSettingInfoService.getByCompany(null));
    }

}
